import * as React from 'react';
import { Spinner, SpinnerSize } from 'office-ui-fabric-react/lib/Spinner';
import './styles.less'

export interface AppProps {

}

export interface AppState {
  loading: boolean
}

export default class App extends React.Component<AppProps, AppState> {
  constructor(props, context) {
    super(props, context);
    this.state = {
      loading: false
    }
  }

  show = () => {
    this.setState({ loading: true })
  }

  hide = () => {
    this.setState({ loading: false })
  }

  render() {
    return (
      <div>
        {
          this.state.loading && <div className="loading">
            <Spinner size={SpinnerSize.large} label="加载中" ariaLive="assertive" />
          </div>
        }
      </div>
    );
  }
}
